import request from '@/utils/request'

// 查询合同信息列表
export function listContracts(query) {
  return request({
    url: '/business/contracts/list',
    method: 'get',
    params: query
  })
}

// 查询合同信息详细
export function getContracts(id) {
  return request({
    url: '/business/contracts/' + id,
    method: 'get'
  })
}

// 新增合同信息
export function addContracts(data) {
  return request({
    url: '/business/contracts',
    method: 'post',
    data: data
  })
}

// 修改合同信息
export function updateContracts(data) {
  return request({
    url: '/business/contracts',
    method: 'put',
    data: data
  })
}

// 删除合同信息
export function delContracts(id) {
  return request({
    url: '/business/contracts/' + id,
    method: 'delete'
  })
}

//查询所有的租户
export function getUser() {
  return request({
    url: '/business/contracts/getUser',
    method: 'get',
    permission: 'business:contracts:list'
  })
}

//查询详情
export function getContractsDetail(id) {
  return request({
    url: '/business/contracts/detail/' + id,
    method: 'get',
    permission: 'business:contracts:detail'
  })
}
